Skip to content

Harden against rogue agents (safe git + jail cleanup + more verifier checks) - #15

Merged
ardecvz merged 7 commits into
rails:mainfrom
ardecvz:audit/security
Oct 27, 2026
Merged

ardecvz merged 7 commits into
rails:mainfrom
ardecvz:audit/security

Conversation

@ardecvz

@ardecvz ardecvz commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator
  • Trials keep their git state outside the app dir, so the agent's .git can't affect results.
  • Miniswen: --jail stops even when miniswen is killed, so agent processes can't run into verification.
  • Verifier: reject results when Minitest's core methods are redefined outside its gems.
  • Verifier: recorded test failures score 0.0 even if the tests exit successfully.
  • Verifier: tests that never ran score 0.0, so a run can't pass by skipping them.

Plus, some nice to have future-proofing:

  • miniswen-installed: a step inside multi task without a result fails instead of reusing the previous one.
  • Docker: run commands as root, so non-root images work.

@ardecvz
ardecvz requested review from baygeldin, palkan and skryukov and a balanced review from Copilot October 21, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Verification bypasses and incomplete proxy cleanup remain unresolved.

3 open issues
What changed in this PR

This PR hardens trial isolation and verification against agent interference, while improving multistep result handling and support for non-root Docker images.

Changes:

  • Move trial Git state outside the application directory and disable global/system Git configuration.
  • Add jail parent-death cleanup and strengthen Minitest tampering and failure checks.
  • Clear stale Miniswen results and execute Docker commands as root.
File Description
test/​miniswen/​jail_test.rb Test holder termination after parent death.
test/​lemans/​trial/​verifier_test.rb Test recorded failures overriding a clean exit.
test/​lemans/​trial/​snapshot_test.rb Check isolated Git paths and configuration.
test/​lemans/​trial_test.rb Update Git isolation and patch replay assertions.
test/​lemans/​test_eport_lemans.rb Test detection of a redefined Minitest runner.
test/​lemans/​environments/​test_docker.rb Assert root execution and upload setup.
test/​lemans/​agents/​test_miniswen_installed.rb Assert stale result removal before execution.
lib/​miniswen/​jail.rb Add a parent-death signal to the jail holder.
lib/​lemans/​trial/​verifier/​assets/​lemans_minitest_reporter.rb Check core runner source locations for tampering.
lib/​lemans/​trial/​verifier.rb Score recorded failures as zero when using exit-based rewards.
lib/​lemans/​trial/​snapshot.rb Store baseline state in the isolated Git directory.
lib/​lemans/​trial/​patch.rb Isolate patch Git state and adjust restoration.
lib/​lemans/​environments/​docker.rb Run commands and upload directory creation as root.
lib/​lemans/​agents/​miniswen_installed.rb Remove previous results before each run.
CHANGELOG.md Document the hardening and compatibility changes.

Review effort: Balanced

Comment thread lib/miniswen/jail.rb Resolved
@ardecvz
ardecvz force-pushed the audit/security branch 2 times, most recently from 35476fe to bdb48e3 Compare October 22, 2026 01:09

@palkan palkan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ardecvz
ardecvz merged commit da702a8 into rails:main Oct 27, 2026
2 checks passed
@ardecvz
ardecvz deleted the audit/security branch October 27, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants